package com.cili.learning.springbootwebsocket.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;

/**
 * @author 码头薯条Pro
 * @date 2025/7/14 23:37
 * <p></p>
 * <p>
 * 视频讲解链接：
 * <p>
 * 题解链接：
 * <p>
 * 题目链接：
 */

@Configuration
public class SchedulerConfig {
    @Bean
    public ThreadPoolTaskScheduler taskScheduler() {
        ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
        scheduler.setPoolSize(5);
        scheduler.setThreadNamePrefix("ws-sockjs-task-");
        scheduler.setRemoveOnCancelPolicy(true);
        return scheduler;
    }
}
